#!/usr/bin/env node

// eslint-disable-next-line @typescript-eslint/no-var-requires
const program = require('commander');

const inquirer = require('inquirer');

const Prompt = require('./Prompt');

const bootstrap = require('./cli').bootstrap;

async function initAction() {
  const { transformer } = await inquirer.prompt(Prompt.selectProject);
  console.log(transformer, '');
  try {
    bootstrap(transformer);
  } catch (e) {
    console.error(e);
  }
}

async function main() {
  program.version('0.0.1').action(initAction);
  await program.parseAsync(process.argv);
}

main();
